Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-cli

Package Overview
Dependencies
Maintainers
5
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-cli

Babel command line.

  • 6.26.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created

What is babel-cli?

The babel-cli package provides a command line interface for Babel, a JavaScript compiler that allows you to use next generation JavaScript, today. It can transform your JavaScript files using Babel plugins and presets, making it easier to write modern JavaScript code that works in older environments.

What are babel-cli's main functionalities?

Transpile JavaScript files

This command transpiles all JavaScript files in the 'src' directory and outputs the transformed files into the 'lib' directory. It uses the Babel configuration specified in your project to determine how to transform the code.

babel src --out-dir lib

Watch files for changes

This command is similar to the previous one, but it also watches the 'src' directory for changes. Whenever a file is modified, Babel will automatically re-transpile the file and output the updated version to the 'lib' directory.

babel src --out-dir lib --watch

Specify presets and plugins

This command allows you to specify Babel presets and plugins directly in the command line. In this example, it uses the '@babel/preset-env' preset and the '@babel/plugin-transform-arrow-functions' plugin to transform the code.

babel src --out-dir lib --presets @babel/preset-env --plugins @babel/plugin-transform-arrow-functions

Other packages similar to babel-cli

Keywords

FAQs

Package last updated on 16 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc